package net.teamclerks.rpgf.scene.map.cell;

import net.teamclerks.rpgf.script.action.CellAction;
import net.teamclerks.rpgf.script.director.Director;

/**
 * A space on the Map which an Avatar can occupy. In a single-cell
 * RPG, an Avatar will occupy exactly 1 (no more, no less) Cell at
 * a time, but in larger RPGs (possibly 3D games) an Avatar can
 * occupy multiple Cells at a time, which gives the game more of a
 * "round" feel as opposed to moving one square at a time.
 * @author msmith
 *
 */
public abstract class Cell
{
  /// CONTROL DATA ///
  /**
   * The latitude of this cell.
   */
  protected long latitude;
  /**
   * The longitude of this cell.
   */
  protected long longitude;
  /**
   * The system's Director reference.
   */
  protected Director director;
  protected CellAction action;
  
  /// DENY CONSTRUCTOR ///
  private Cell(){}
  
  /// PUBLIC CONSTRUCTOR ///
  public Cell(Director director)
  {
    this();
    this.director = director;
    this.action = new CellAction(this.director)
    {
      @Override public void act(){}
    };
  }
  
  /// PUBLIC METHODS ///
  /**
   * Gets this cell's latitude.
   * @return latitude
   */
  public final long getLatitude()
  {
    return this.latitude;
  }
  /**
   * Sets this cell's latitude.
   * @param latitude
   */
  public final void setLatitude(long lat)
  {
    this.latitude = lat;
  }
  /**
   * Gets this cell's longitude.
   * @return longitude
   */
  public final long getLongitude()
  {
    return this.longitude;
  }
  /**
   * Sets this cell's longitude.
   * @param longitude
   */
  public final void setLongitude(long longi)
  {
    this.longitude = longi;
  }
  /**
   * Gets the <code>CellAction</code> that this <code>Cell</code>
   * may have.
   * @return actions
   */
  public final CellAction getActions()
  {
    return action;
  }
  /**
   * Sets the <code>CellAction</code> for this <code>Cell</code>.
   * @param actions
   */
  public final void setAction(CellAction action)
  {
    this.action = action;
  }
}